#include "rssitem.h"
#include "formmain.h"


RssItem::RssItem(const QString &feedName, const QString &title, const QString &link, const QString &description, const QString &date, bool seen, bool hidden) {
    this->title = title;
    this->link = link;
    this->description = description;
    this->date = date;
    this->seen = seen;
    this->hidden = hidden;
    this->feedName = feedName;
}

void RssItem::updateRepresentation(QWebView *view) {
    view->setHtml(FormMain::getHeader(this->getTitle()) + this->description);
    seen = true;
}

void RssItem::deleteRepresentation(QTreeWidget *widget) {
    delete widget->selectedItems().at(0);
    hidden = true;
}
